﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="product.aspx.cs" Inherits="product" MasterPageFile="~/Site.master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="server">
  Sản phẩm
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="home" runat="server">

    <div class="top">
        <div class="left"></div>
        <div class="right"></div>
        <div id="content">
            <asp:FormView ID="productdetail" runat="Server" >
            <HeaderTemplate>            
                <div class="top"><%#Eval("product_name") %></div>
            </HeaderTemplate>
        
            <ItemTemplate>         
              <div class="middle">
                <div style="width: 100%; margin-bottom: 30px;">
                    <script type="text/javascript">
                        $('#holder1').imageZoom({
                            small: 'images/<%# Eval("image") %>',
                            original: 'images/<%# Eval("image") %>',
                            viewpoint: {
                                width: 250,
                                height: 175
                            }
                        });
                    </script>
                    <table style="width: 100%; border-collapse: collapse;">
                    <tr>
                      <td style="text-align: center; width: 250px; vertical-align: top;"><div id="holder1"><a href='images/<%# Eval("image") %>' title='<%#Eval("product_name") %>' class="thickbox" rel="gallery"><img src='images/<%#Eval("image") %>' title='<%#Eval("product_name") %>' alt='<%#Eval("product_name") %>' id="image" style="margin-bottom: 3px;" width="250px" height="250px"/></a></div><br />
                        <span style="font-size: 11px;">'Ấn vào để xem ảnh'</span></td>
                      <td style="padding-left: 15px; width: 296px; vertical-align: top;">             
                          <table width="100%">              
                              <tr>
                                <td><b>Price:</b> <asp:Label ID="price" runat="server" Text='<%# Bind("price") %>'></asp:Label> vnđ</td>                
                              </tr>
                              <tr><td>          
                                <div class="content">
                                   <span>Số lượng</span>
                                  <span><asp:TextBox ID="text_qt" runat="server" Text='1' Width="30"></asp:TextBox></span>              
                                  <asp:Button ID="buy" runat="server" CssClass="button" Text="Chon mua" onclick="buy_Click" />
                                </div>
                                <div>
                                    <asp:Label ID="id_product" Visible=false runat="server" Text='<%# Bind("product_id") %>'></asp:Label>
                                    <asp:Label ID="category_id" Visible=false runat="server" Text='<%# Bind("category_id") %>'></asp:Label>
                                </div>
                               </td></tr>
                          </table>
                        </td>
                    </tr>
                  </table>
                </div>
              </div>       
            </ItemTemplate>       
            </asp:FormView>
            <ul class="tabs">
                <li><a href="#Product_des">Mô tả sản phẩm</a></li>
                 <li><a href="#Review">Ý kiến</a></li>
                <li><a href="#Related">Sản phẩm liên quan</a></li>
            </ul>

            <div class="tab_container"> 
                <div id="Product_des" class="tab_content">
                    <asp:FormView ID="product_des" runat="Server">
                        <ItemTemplate><%# Eval("product_des")%></ItemTemplate>
                    </asp:FormView>
                </div>
                <div id="Review" class="tab_content">
                     <asp:DataList runat="Server" ID="listReview">
                        <ItemTemplate>
                            <div style="float:left;width:600px;border-bottom:1px dotted #cecece;padding-bottom:20px;padding-top:10px;">
                                <div style="float:left;width:142px;">                                    
                                    <div style="float:left;border:2px solid #cecece;padding:2px;height:87px;width:154px;"><img src="images/logo.png" /></div>
                                </div>
                                <div style="float:right;width:400px;">
                                <div style="font-size: 1.1em;font-weight:bold;margin-bottom:5px;">Ý kiến của <%#Eval("Customer_name")%>:</div>
                                <div style="float:left;border:1px solid #cecece;width:350px;padding:5px;">
                                    <div style="font-size:1em;font-style:italic;padding-bottom:10px;"><%#Eval("subject") %>:</div>
                                    <div style="font-size:11px;padding-left:20px;"><%#Eval("comment") %></div>
                                    <div style="float:right;margin-right:10px;font-size:8px;color:#cecece;"><%#Eval("date") %></div>
                                </div>
                                </div>
                            </div>
                            
                        </ItemTemplate>
                     
                     </asp:DataList>
                     <div style="float:both;width:600px;margin-bottom:20px;"></div>
                     <div style="font-weight:bold;font-size:1.2em;margin-bottom:5px">Ý kiến</div>
                    <div  style="border:1px solid #cecece;padding:10px;margin-bottom:10px;" >
                        <div style="margin-bottom:5px">Chủ đề:</div>
                        <asp:TextBox  width="100%" ID="subjectReview" runat="server" Text=""></asp:TextBox>
                        <div style="margin-bottom:5px">Nội dung:</div>
                        <asp:TextBox TextMode="MultiLine" width="100%" Height="100px" ID="commentReview" runat="server"></asp:TextBox>
            
                    </div>
                    <div  style="border:1px solid #cecece;padding:10px;margin-bottom:10px;text-align:center;" >
                    <asp:Button runat="Server" Text="SUBMIT" ID="submitReview" CssClass="button" onclick="submitReview_Click" />               
                
                    </div>
                </div>
                <div id="Related" class="tab_content">
                    <asp:datalist ID="dtlRelated" runat="Server" RepeatColumns="3" >
                        <ItemTemplate>
                            <table>                          
                                <tr>
                                    <td>
                                        <a href='product.aspx?id=<%# DataBinder.Eval(Container.DataItem, "product_id") %>'><img src='images/<%# DataBinder.Eval(Container.DataItem, "image") %>' Width="140px" height="140px" /></a><br />
                                        <a href='product.aspx?id=<%# DataBinder.Eval(Container.DataItem, "product_id") %>'><%# DataBinder.Eval(Container.DataItem, "product_name") %></a><br />
                                        Price: <span style="color: #900; font-weight: bold;"><%# DataBinder.Eval(Container.DataItem, "price") %></span><br />
                                    </td>
                                </tr>
                            </table>                         
                        </ItemTemplate>
                    </asp:datalist>
                </div>
            </div>
        </div>
    </div>           
</asp:Content>

